home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / gedit-2 / plugins / snippets / perl.xml < prev    next >
Encoding:
Extensible Markup Language  |  2009-04-14  |  2.9 KB  |  127 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <snippets language="Perl">
  3.   <snippet id="perl">
  4.     <text><![CDATA[#!/usr/bin/perl
  5. $0]]></text>
  6.     <tag>perl</tag>
  7.     <description>#!/usr/bin/perl</description>
  8.   </snippet>
  9.   <snippet id="ife">
  10.     <text><![CDATA[if ($1) {
  11.     ${2:# body...}
  12. } else {
  13.     ${3:# else...}
  14. }
  15. ]]></text>
  16.     <description>Conditional if..else</description>
  17.     <tag>ife</tag>
  18.   </snippet>
  19.   <snippet id="ifee">
  20.     <text><![CDATA[if ($1) {
  21.     ${2:# body...}
  22. } elsif ($3) {
  23.     ${4:# elsif...}
  24. } else {
  25.     ${5:# else...}
  26. }
  27. ]]></text>
  28.     <description>Conditional if..elsif..else</description>
  29.     <tag>ifee</tag>
  30.   </snippet>
  31.   <snippet id="xunless">
  32.     <text><![CDATA[${1:expression} unless ${2:condition};
  33. ]]></text>
  34.     <description>Conditional one-line</description>
  35.     <tag>xunless</tag>
  36.   </snippet>
  37.   <snippet id="xif">
  38.     <text><![CDATA[${1:expression} if ${2:condition};
  39. ]]></text>
  40.     <description>Conditional one-line</description>
  41.     <tag>xif</tag>
  42.   </snippet>
  43.   <snippet id="eval">
  44.     <text><![CDATA[eval {
  45.     ${1:# do something risky...}
  46. };
  47. if ($@) {
  48.     ${2:# handle failure...}
  49. }
  50. ]]></text>
  51.     <description>Try/Except</description>
  52.     <tag>eval</tag>
  53.   </snippet>
  54.   <snippet id="fore">
  55.     <text><![CDATA[foreach ${1:my $${2:x} }(@${3:array}) {
  56.     ${4:# body...}
  57. }
  58. ]]></text>
  59.     <description>Loop</description>
  60.     <tag>fore</tag>
  61.   </snippet>
  62.   <snippet id="for">
  63.     <text><![CDATA[for (my $${1:var} = 0; $$1 < ${2:expression}; $$1++) {
  64.     ${3:# body...}
  65. }
  66. ]]></text>
  67.     <description>Loop</description>
  68.     <tag>for</tag>
  69.   </snippet>
  70.   <snippet id="sub">
  71.     <text><![CDATA[sub ${1:function_name} {
  72.     ${2:# body...}
  73. }
  74. ]]></text>
  75.     <description>Function</description>
  76.     <tag>sub</tag>
  77.   </snippet>
  78.   <snippet id="hashpointer">
  79.     <text><![CDATA[ => ]]></text>
  80.     <accelerator><![CDATA[<Shift><Alt>l]]></accelerator>
  81.     <description>hash pointer</description>
  82.   </snippet>
  83.   <snippet id="if">
  84.     <text><![CDATA[if ($1) {
  85.     ${2:# body...}
  86. }
  87. ]]></text>
  88.     <description>Conditional</description>
  89.     <tag>if</tag>
  90.   </snippet>
  91.   <snippet id="xfore">
  92.     <text><![CDATA[${1:expression} foreach @${2:array};
  93. ]]></text>
  94.     <description>Loop one-line</description>
  95.     <tag>xfore</tag>
  96.   </snippet>
  97.   <snippet id="xwhile">
  98.     <text><![CDATA[${1:expression} while ${2:condition};
  99. ]]></text>
  100.     <description>Loop one-line</description>
  101.     <tag>xwhile</tag>
  102.   </snippet>
  103.   <snippet id="slurp">
  104.     <text><![CDATA[my $${1:var};
  105. { local $/ = undef; local *FILE; open FILE, "<${2:file}"; $$1 = <FILE>; close FILE }
  106. ]]></text>
  107.     <description>Read File</description>
  108.     <tag>slurp</tag>
  109.   </snippet>
  110.   <snippet id="unless">
  111.     <text><![CDATA[unless ($1) {
  112.     ${2:# body...}
  113. }
  114. ]]></text>
  115.     <description>Conditional</description>
  116.     <tag>unless</tag>
  117.   </snippet>
  118.   <snippet id="while">
  119.     <text><![CDATA[while ($1) {
  120.     ${2:# body...}
  121. }
  122. ]]></text>
  123.     <description>Loop</description>
  124.     <tag>while</tag>
  125.   </snippet>
  126. </snippets>
  127.